package lesson07;

/**
 * 维修工
 */
public class Mechanic {
    public void serviceForCar(Serviceable serviceable){
        serviceable.drive();
        serviceable.turnupEngine();
        serviceable.changeOil();
    }
    public void serviceForNewCar(NewEngineService service){
        service.changeBuff();

    }

    public static void main(String[] args) {
        Mechanic mechanic = new Mechanic();
        mechanic.serviceForCar(new Auto());
        mechanic.serviceForCar(new Ferrair());
        mechanic.serviceForCar(new LXOne());
        mechanic.serviceForNewCar(new Peng());
        mechanic.serviceForNewCar(new LXOne());

        System.out.println(Serviceable.TYPE);
    }
}
